using System;
using System.Collections.Generic;
using System.Text;

namespace OrbitOne.Feed.Domain {
    /// <summary>
    /// A container class for holding maximum 12 keywords, used by Itunes
    /// </summary>
    public class Keywords {
        private const Int32 maximumNumberOfKeywords = 12;
        private List<String> _innerList = new List<String>();
        /// <summary>
        /// Adds a keyword to the keyword collection
        /// </summary>
        /// <param name="keyword"></param>
        public void Add(String keyword) {
            if (String.IsNullOrEmpty(keyword)) {
                if (_innerList.Count < maximumNumberOfKeywords) {
                    _innerList.Add(keyword);
                }
            }
        }
        /// <summary>
        /// Gets the count.
        /// </summary>
        /// <value>The count.</value>
        public Int32 Count {
            get { return _innerList.Count; }
        }
        /// <summary>
        /// Converts to an array.
        /// </summary>
        /// <returns></returns>
        public String[] ToArray() {
            return this._innerList.ToArray();
        }
    }
}
